package com.demo.controller;

import com.demo.model.User;
import com.demo.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * Vincent 创建于 2016/6/15.
 */
@Controller
public class IndexController {
    @Autowired
    private IUserService userService;

    @RequestMapping("/")
    public ModelAndView index(){
        ModelAndView modelAndView = new ModelAndView("/index");
        User user = userService.get(1);
        modelAndView.addObject("user",user);
        return modelAndView;
    }

}
